<?php

#parent of current xml tag
$xmlParent = "";

if(@$_GET['xmlparent']){
	
	$xmlParent = $_GET['xmlparent'];
}

# Top level xml tags
$top_level_tags = $XML1 -> getChildrenOfTag($xmlParent);

$currentLanguage = "en";

if(@$_GET["language"]){
	
	$currentLanguage = $_GET["language"];
}

addContent("<table>");

# For each
foreach ($top_level_tags -> getTagIDs() as $tag_id){
	
	# Get tag details
	$obTag = $top_level_tags -> getTag($tag_id);
	
	$flagHasChildren = $XML1 -> hasChildren($tag_id);
	
	//addContent($obTag->getData("x_name")."<br/>");
	
	if($flagHasChildren){
	
		addContent("<tr><td valign=\"top\"><a href=\"javascript:void(0)\" onclick=\"onclickPlusDir(this,'".$obTag->getData("x_id")."','".$obTag->getData("x_section")."','".$currentLanguage."')\" style=\"text-decoration:none;\">+</a></td>");
	
		addContent("<td><a href=\"javascript:void(0)\" style=\"text-decoration:none;\" onmouseover=\"onmouseoverXMLTags(this)\" onmouseout=\"onmouseoutXMLTags(this)\" onclick=\"onclickXMLTags(this,'".$obTag->getData("x_section")."','".$obTag->getData("x_id")."','".$currentLanguage."')\">".$obTag->getData("x_name")."</a><div></div></td></tr>");
	}
	else{
		
		addContent("<tr><td valign=\"top\"></td>");
	
		addContent("<td><a href=\"javascript:void(0)\" style=\"text-decoration:none;\" onmouseover=\"onmouseoverXMLTags(this)\" onmouseout=\"onmouseoutXMLTags(this)\" onclick=\"onclickXMLTags(this,'".$obTag->getData("x_section")."','".$obTag->getData("x_id")."','".$currentLanguage."')\">".$obTag->getData("x_name")."</a><div></div></td></tr>");
	}
	
	//<td valign=\"top\"><a href=\"javascript:void(0)\" onclick=\"onclickPlusDir(this,'','".$value["x_section"]."')\" style=\"text-decoration:none;\">+</a></td><td><a href=\"javascript:void(0)\" style=\"text-decoration:none;\">".$value["x_section"]."</a><div></div></td>
}

addContent("</table>");



?>